package com.happyclub.lcy.dao;

import com.happyclub.pojo.TbTravel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;



public interface ITravel extends JpaRepository<TbTravel,String > {
    //根据游记Id 查询游记
    TbTravel findTbTravelById(String Id);
    //点赞次数加一
    @Modifying
    @Query(value = "update TB_TRAVEL set TRAVEL_LIKE = TRAVEL_LIKE+1 where ID= ?1",nativeQuery = true)
    int upTravelLike(String travelId);
    //浏览次数加一
    @Modifying
    @Query(value = "update TB_TRAVEL set READ_NUM = READ_NUM+1 where ID= ?1",nativeQuery = true)
    int upReadNum(String travelId);
}
